package com.lagou.client;

import com.lagou.client.invoke.RpcConsumer;
import com.lagou.common.api.IUserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author Kirito
 * @description:
 * @date 2020/05/26
 */
@SpringBootApplication
@EnableScheduling
public class ClientBootstrap {
    public static void main(String[] args) {
        SpringApplication.run(ClientBootstrap.class, args);
    }

    @Bean
    public IUserService userService() {
        RpcConsumer consumer = new RpcConsumer();
        IUserService userService = (IUserService) consumer.createProxy(IUserService.class);
        return userService;
    }
}
